<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Update Confirmation</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<? include "../header.php" ?>
</head>
<body>
<?php
//This connects to the database
include_once "devcon.php";

function noCents($dollars){
	$val = $dollars * 100;
	return $val;
}

function wCents($cents){
	$val = $cents * 100;
	return $val;
}

//Run the Update Script
$size = count($_POST['price']);
$i = 0;
while ($i < $size) {
$price = noCents($_POST['price'][$i]);
$id = $_POST['id'][$i];
$query = "UPDATE prices SET price = '$price' WHERE id = '$id' LIMIT 1";
mysql_query($query) or die ("Error in query: $query");
	echo '<div align="center">';
	echo "$price<br /><em>Updated!</em><br /><br />";
	echo '</div>';
	++$i;
}
mysql_close($link);

?>
<br />
<br />
<div align="center">
	<p id="wrapfooter">
		<a href="../index.php" class="breadcrumbs">Home Page</a>
	</p><br /><p>
		<a href="UpdatePrices.php" class="breadcrumbs">Return Price Updater</a>
</p></div>
<?
include "../footer.php";
?>

</body>
</html>